Getting Started

Introduction

R based programs to analyze and visualize embryo lineage after the cell data are extracted from 3D movies in Acetree Intended to process data tables where:

  • each table represent one embryo
  • each row represents one cell at a specific time point, with columns:
    • time: imaging time this cell read is created
    • cell: cell name
    • x: x position
    • y
    • z
    • blot: reproter expression

LineageProcessing.R contains functions to process one single embryo entity, and slices from embryo entities, which are the dependencies of other codes. INcluding functions CD_Processing.R are functions to work with a directory of several embryo data tables. Including fucntions to load data tables, retrieve specific cells and lineages data from multiple embryos, and operations that are only possible with multiple embryos (e.g. depth correction) drawEmb.R contains functions that plot all nucleus in an embryo in 3D

Example Workflow

source("LineageProcessing.R")
## Loading required package: dplyr
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
source("CD_Processing.R")
source("drawEmb.R")
## Loading required package: plotly
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout

Read a directory of embryo tables

embryos <- CD_In(directory = "JIM767_25/", prefix = "CD", TIME = FALSE, AuxInfo = FALSE)

Optional: implement depth correction

# get the correction parameters for the model of fluoresence loss by depth 
model <- depthCorrectionParm(embryos, lineage = c("ABara", "ABalp", "E"), alignAt = "E", startT = 30, endT = 150, exc_zMin = 0.2, exc_zMax = 1, zMax = 67)
## `summarise()` has grouped output by 'time'. You can override using the
## `.groups` argument.
# correct the embryos' data with the model
embryos <- embryos |> 
  dataCorrection(lineage=c("ABara", "ABalp", "P1"), model = model, zMax = 67, exc_zMin = 0.2, exc_zMax = 1)

Plot the reporter expression against time for a particular lineage or specified cells for all embryos

yrange = list(0,16000)
xrange = list(-50,150)
# several specified cells in each embryo
embNames <- names(embryos[["CD"]]) #set up palette to make color consistent for the same embryo across different plots
library(viridis)
## Loading required package: viridisLite
emb_palette <- turbo(length(embNames)) |> setNames(embNames)
cellsExp <- strsplit("ABal, ABalp, ABalpa, ABalpaa, ABalpaaa, ABalpaaaa, ABalpaaaaa", split=", ")[[1]]
fig_blot_cells <- embryos|>plotBlotLine(title = 'specific cells example', 
                            aligningCell = cellsExp[1], alignTime = 0, cells = cellsExp, 
                            color_palette = emb_palette,
                            xrange = xrange, yrange = yrange)
fig_blot_cells
# several lineages in each embryo
lineExp <- c("ABalp", "ABara", "ABplpappp", "ABprpappp")
fig_blot_lines <- embryos|>plotBlotLine(title = 'lineages example', 
                            aligningCell = lineExp[1], alignTime = 0, lineages = lineExp, 
                            color_palette = emb_palette,
                            xrange = xrange, yrange = yrange)
fig_blot_lines

Plot the embryo nucleus positions in 3D

figO <- drawEmbLine(
  embryos[["CD"]][[5]], 130,
  lineages = list("MSaa", "MSap","MSpa", "MSpp", "C", "E"),
  colors = list(rgb(1,1,0), rgb(0,1,0), rgb(1,0,1), rgb(0,0,1), rgb(0.5,0,1), rgb(1,0,0)),
  opacitys = list(1,1,1,1,0.4,0.6),otherOpacity = 0.2,
  showAxis = T)
figO[[1]]